package com.yang.design.create.singletonPattern;

/**
 * 饿汉式-同步方法   效率低
 */
public class Singleton_03 {
    private static Singleton_03 instance;
    private Singleton_03(){}

    public synchronized static Singleton_03 getInstance() {
        if (instance == null){
            instance = new Singleton_03();
        }
        return instance;
    }
}
